#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

#define FOR(i,a,n) for(int i=a,_n(n);i<_n;++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

vector<char> v[1010];
vector<int> prime;

bool IsPrime(int x)
{
    FOR(i,2,x) if(x%i==0) return false;
    return true;
}

void Init()
{
    FOR(i,2,1000) if(IsPrime(i))
    {
        //printf("prime %d\n",i);
        prime.push_back(i);
    }
};

class DSU
{
    vector<int> father;
    public:
    DSU(int n)
    {
        father.reserve(n+10);
        REP(i,n+10) father[i] = i;
    }
    int GetGroup(int x)
    {
        if(father[x]!=x) father[x] = GetGroup(father[x]);
        return father[x];
    }
    bool Merge(int x,int y)
    {
       // printf("Merge %d %d\n",x,y);
        x = GetGroup(x);
        y = GetGroup(y);
        if(x==y) return false;
        else father[x] = y;
        return true;
    }
};

bool FillIn(string &s,vector<int>& gp)
{
    int pos = -1;
    char c;
    FOR(i,gp.size(),s.size()+1) if(!v[i].empty())
    {
        c = v[i].back();
        v[i].pop_back();
        pos = i;
        break;
    }
    if(pos==-1) return false;
    if(pos!=gp.size())
    {
        v[pos-gp.size()].push_back(c);
    }
    REP(i,gp.size())
    {
        //printf("s[%d]=%c\n",gp[i],c);
        s[gp[i]-1] = c;
    }
    return true;
}

void PrintAns(string& s)
{
    DSU dsu(s.size()+1);
    REP(i,prime.size())
    {
        if(prime[i]>s.size()) break;
        FOR(j,2,s.size()/prime[i]+1) dsu.Merge(prime[i],prime[i]*j);
    }
    string ans = s;
    vector<int> gp[1010];
    REP(i,s.size()) gp[dsu.GetGroup(i+1)].push_back(i+1);
    REP(i,1010) if(gp[i].size())
    {
        //printf("Fill in gid = %d,size=%d\n",i,gp[i].size());
        if(!FillIn(ans,gp[i]))
        {
            puts("NO");
            return;
        }
    }
    puts("YES");
    cout<<ans<<endl;
}

int main()
{
    Init();
    string s;
    while(cin>>s)
    {
        REP(i,s.size()+1) v[i].clear();
        vector<int> cnt(26,0);
        REP(i,s.size()) ++cnt[s[i]-'a'];
        REP(i,26) if(cnt[i]) v[cnt[i]].push_back('a'+i);
       // REP(i,1010) if(v[i].size()) printf("pos = %d,size = %d\n",i,v[i].size());
        PrintAns(s);
    }
	return 0;
}
